package com.endurance.config;

import org.springframework.cloud.gateway.filter.factory.GatewayFilterFactory;
import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: sunlin
 * @Date: 2024-04-21 0:30
 * @Version: 1.0
 * @Description: 网关配置类
 */
//@Configuration
public class GatewayConfig {

    @Bean
    public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
        return builder.routes().route("user_route", r -> r.path("/user/**").uri("http://localhost:10003")).route("product_route", r -> r.path("/product/**").uri("htto://localhost:1004")).build();
    }

}
